﻿<%@ Page Title="角色模块权限维护" Language="C#" MasterPageFile="~/masterPage/admin/Manage.master"
    AutoEventWireup="true" CodeFile="RolesModulePower.aspx.cs" Inherits="Roles_ManageRoles_power" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div>
        <center>
            <table cellspacing="0" cellpadding="4" rules="all" border="1" style="background-color: White;
                border-color: #003366; border-width: 1px; border-style: Double; width: 580pt;
                border-collapse: collapse;">
                <tr align="left" style="background-color: #99FF99; height: 18pt">
                    <td align="center" style="width: 90pt">
                        角色
                    </td>
                    <td style="width: 200pt; background-color: #F7F7DE">
                        <telerik:RadComboBox ID="rdcmbRole" runat="server" Culture="ja-JP" DataSourceID="SqlDataSource1"
                            DataTextField="Description" DataValueField="mg_id" OnSelectedIndexChanged="rdcmbRole_SelectedIndexChanged">
                        </telerik:RadComboBox>
                        <%--<telerik:RadButton ID="rdbtnSearch" runat="server" onclick="RadButton1_Click" 
                            Text="查询"></telerik:RadButton>--%>
                    </td>
                    <td align="center">
                        名称
                    </td>
                    <td style="background-color: #F7F7DE">
                        <asp:Label ID="lb_mg_name" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
            </table>
            <hr style="width: 98%; margin: 5pt 0pt 5pt 0pt" />
            <table border="0" cellpadding="2" cellspacing="0" class="text12pt" style="width: 580pt;
                margin: 0pt 0pt 5pt 0pt">
                <tr>
                    <td style="width: 120pt">
                        &nbsp
                    </td>
                    <td class="text14pt" style="text-align: center; font-size: 14px; font-family: 楷体">
                        管理员权限
                    </td>
                    <td style="width: 120pt; text-align: right">
                        <asp:Button ID="bn_all_open" runat="server" Text="全部开放" CssClass="text9pt" OnClick="bn_all_open_Click" />
                        <asp:Button ID="bn_all_close" runat="server" Text="全部禁止" CssClass="text9pt" OnClick="bn_all_close_Click" />
                    </td>
                </tr>
            </table>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                <telerik:RadGrid ID="rgridMenuRole" runat="server" AllowPaging="True" AllowSorting="True"
                    ShowStatusBar="True" PageSize="10" DataSourceID="sqs_Func_Power" GridLines="Both"
                    OnItemCommand="rgridMenuRole_ItemCommand" OnItemCreated="rgridMenuRole_ItemCreated">
                    <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="fi_no2" DataSourceID="sqs_Func_Power">
                        <NoRecordsTemplate>
                            没有任何权限的数据！</NoRecordsTemplate>
                        <Columns>
                            <telerik:GridBoundColumn DataField="fi_no1" FilterControlAltText="Filter fi_no1 column"
                                HeaderText="主编号" SortExpression="fi_no1" UniqueName="fi_no1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="fi_name1" FilterControlAltText="Filter fi_name1 column"
                                HeaderText="主功能名称" ReadOnly="True" SortExpression="fi_name1" UniqueName="fi_name1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="fi_no2" FilterControlAltText="Filter fi_no2 column"
                                HeaderText="子编号" ReadOnly="True" SortExpression="fi_no2" UniqueName="fi_no2">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="fi_name2" FilterControlAltText="Filter fi_name2 column"
                                HeaderText="子功能名称" ReadOnly="True" SortExpression="fi_name2" UniqueName="fi_name2">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn DataField="is_enable" DataType="System.Byte" FilterControlAltText="Filter is_enable column"
                                HeaderText="权限设置" SortExpression="is_enable" UniqueName="is_enable">
                                <ItemTemplate>
                                    <asp:Label ID="lb_fi_no1" runat="server" Text="" Visible="false"></asp:Label>
                                    <asp:Label ID="lb_fi_no2" runat="server" Text="" Visible="false"></asp:Label>
                                    <asp:RadioButton ID="rb_open" runat="server" CssClass="text9pt" GroupName="rb_is_enable"
                                        Text="开放" OnCheckedChanged="rb_open_CheckedChanged" />&nbsp;
                                    <asp:RadioButton ID="rb_close" runat="server" CssClass="text9pt" GroupName="rb_is_enable"
                                        Text="禁止" OnCheckedChanged="rb_close_CheckedChanged" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </telerik:RadAjaxPanel>
        </center>
        <asp:Literal ID="lt_show" runat="server"></asp:Literal>
        <asp:HiddenField ID="hf_enable" runat="server" Value="2" />
        <asp:Label ID="lb_enable" runat="server" Text="2" Visible="false"></asp:Label>
        <asp:Label ID="lb_page" runat="server" Text="" Visible="false"></asp:Label>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
            SelectCommand="SELECT [mg_id], [RoleName], [Description] FROM [aspnet_Roles] ORDER BY [mg_id]">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="sqs_Func_Power" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
            SelectCommand="Select IsNull(f.is_enable, 0) as is_enable, f2.fi_no1, f2.fi_no2, f1.fi_name1, f2.fi_name2 From Func_Item2 f2
                           Inner Join Func_Item1 f1 On f2.fi_no1 = f1.fi_no1
                           Left Outer Join Func_Power f On f2.fi_no2 = f.fi_no2 And f.Role_mg_id = @mg_id
                           Where f2.is_visible = 1 and f1.is_visible = 1 Order by f1.fi_sort1, f2.fi_sort2">
            <%-- ning sql语句中添加了个【f1.is_visible = 1】--%>
            <SelectParameters>
                <asp:Parameter Name="mg_id" DefaultValue="0" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
